package com.letoo.sso.config;

import org.mybatis.spring.mapper.MapperScannerConfigurer;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.letoo.sso.dataaccess.datasource.DbRepository;

@Configuration
@AutoConfigureAfter(MyBatisConfig.class)
public class MyBatisMapperScannerConfig {

  @Bean(name = "mapperScannerConfigurer")
  public MapperScannerConfigurer getMapperScannerConfigurer() {
    MapperScannerConfigurer mapperScannerConfigurer = new MapperScannerConfigurer();
    // 设置属性
    mapperScannerConfigurer.setBasePackage("com.letoo.sso.dataaccess.dao.db");
    mapperScannerConfigurer.setSqlSessionFactoryBeanName("sqlSessionFactory");
    mapperScannerConfigurer.setAnnotationClass(DbRepository.class);
    return mapperScannerConfigurer;
  }

}
